<?php
/**
 *
 */
fily_XMLConverter::registerNamespace('textlabel', fily_TextLabel);
class fily_TextLabel extends fily_Control implements fily_XMLToControl {
	/**
         * 
         * @param string $text
         */
	public function __construct($text = '') {
            parent::__construct('span');
            $this->setText($text);
	}

        protected $text;

        /**
         * set the text
         * @param string $text
         */
        public function setText($text){
           $this->text = $text;
        }

        /**
         * returns the text
         * @return string
         */
        public function getText(){
           return  $this->text ;
        }

         protected function generateHtml(){
                $html = '<' . $this->getTag() . $this->attributes->toString() . ' >'. $this->text .'</'. $this->getTag() .'>';
                return $html;
          }


   public function XMLAttributes(array $attributes, $innerValue) {
        $innerValue = trim($innerValue);
        if(!empty($innerValue)) {
            $this->setText($innerValue);
        }
        parent::XMLAttributes($attributes, $innerValue);
    }


	
}

?>
